﻿<%@ Page Title="Feriados" Language="C#" MasterPageFile="~/Site.Master"
    AutoEventWireup="true" CodeBehind="CadastroFeriado.aspx.cs" Inherits="AcadPosApp.Cadastros.CadastroFeriado" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <style type="text/css">
        .style1
        {
            width: 156px;
        }
        .style2
        {
            width: 130px;
        }
        .style3
        {
            width: 100%;
        }
        .style4
        {
            width: 133px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Panel ID="pnlDados" runat="server" GroupingText="Consulta de Feriados">
        <table class="form-inline">
            <tr>
                <td colspan="3">
                    <asp:Label ID="Label1" runat="server" Text="Estado"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlEstadoPesq" runat="server" AutoPostBack="True" 
                        OnSelectedIndexChanged="ddlEstadoPesq_SelectedIndexChanged" Width="150px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <asp:Label ID="Label8" runat="server" Text="Cidade"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlCidadePesq" runat="server" Width="300px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <asp:Label ID="Label2" runat="server" Text="Data Início"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtDataInicio" required runat="server" 
                        Width="145px" MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtDataInicio_CalendarExtender" runat="server" Enabled="True"
                        TargetControlID="TxtDataInicio">
                    </asp:CalendarExtender>
                </td>
                <td class="style4">
                    <asp:Label ID="Label3" runat="server" Text="Data Fim"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtDataFim" required runat="server" Width="145px" 
                        MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtDataFim_CalendarExtender" runat="server" Enabled="True"
                        TargetControlID="TxtDataFim">
                    </asp:CalendarExtender>
                </td>
                <td class="style2">
                    <br />
                    &nbsp;&nbsp;&nbsp;
                    <asp:Button ID="btnConsultar" runat="server" Text="Consultar" 
                        OnClick="btnConsultar_Click" Width="100px" />
                </td>
            </tr>
        </table>
        <br />
        <asp:GridView ID="gvwFeriados" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CssClass="mGrid" DataKeyNames="ID_FERIADO" EmptyDataText="Dados não localizados..."
            GridLines="Vertical" Width="45%" OnPageIndexChanging="gvwFeriados_PageIndexChanging"
            OnRowCommand="gvwFeriados_RowCommand" 
            OnRowCreated="gvwFeriados_RowCreated" OnRowDataBound="gvwFeriados_RowDataBound">
            <AlternatingRowStyle BackColor="#D3D3D3" />
            <Columns>
                <asp:TemplateField HeaderText="Excluir" ShowHeader="False">
                    <ItemTemplate>
                        <abbr title="Excluir Feriado!">
                            <asp:ImageButton ID="ImgExcluir" runat="server" CausesValidation="false" CommandName="Excluir"
                                formnovalidate="formnovalidate" ImageUrl="~/Imagens/delete.png" OnClientClick="return ShowConfirm('Tem certeza que deseja excluir?', this.ID);"
                                Text="Excluir" Width="20px" />
                        </abbr>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" Width="1%" />
                    <ItemStyle HorizontalAlign="Center" Width="1%" />
                </asp:TemplateField>
                <asp:BoundField DataField="DATA" HeaderText="Data">
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:BoundField>
                <asp:BoundField DataField="DESCRICAO" HeaderText="Descrição">
                    <ItemStyle HorizontalAlign="Left" Width="80%" />
                </asp:BoundField>
            </Columns>
            <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
            <PagerStyle CssClass="pagination" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#1E90FF" Font-Bold="True" ForeColor="White" />
            <SortedAscendingCellStyle BackColor="#F1F1F1" />
            <SortedAscendingHeaderStyle BackColor="#808080" />
            <SortedDescendingCellStyle BackColor="#CAC9C9" />
            <SortedDescendingHeaderStyle BackColor="#383838" />
        </asp:GridView>
        <div class="legenda">
            <asp:Button ID="btnIncluir" runat="server" EnableTheming="True" OnClick="btnIncluir_Click"
                Text="Incluir" Width="100px" formnovalidate="formnovalidate"/>
        </div><br />
    </asp:Panel>
    <br />
    <asp:Panel ID="pnlEdicao" runat="server" GroupingText="Cadastro de Feriados" 
        Visible="False">
        <table class="style3">
            <tr>
                <td>
                    <asp:Label ID="Label4" runat="server" Text="Estado"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlEstado" runat="server" Width="150px" AutoPostBack="True"
                        OnSelectedIndexChanged="ddlEstado_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label5" runat="server" Text="Cidade"></asp:Label>
                    <br />
                    <asp:DropDownList ID="ddlCidade" runat="server" Width="300px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label6" runat="server" Text="Data"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtData" required="" runat="server" Width="150px" MaxLength="10"></asp:TextBox>
                    <asp:CalendarExtender ID="TxtData_CalendarExtender" runat="server" Enabled="True"
                        TargetControlID="TxtData">
                    </asp:CalendarExtender>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label7" runat="server" Text="Descrição"></asp:Label>
                    <br />
                    <asp:TextBox ID="TxtDescricao" required="" runat="server" Width="300px" MaxLength="150" pattern="^((.)(?!\2{3,}))+$" title="Somente são permitidos 3 caracteres iguais e consecutivos." >
                    </asp:TextBox>
                </td>
            </tr>
        </table>
        <br />
        <div class="legenda">
            <asp:Button ID="btnConfirmar" runat="server" Text="Confirmar" 
                OnClick="btnConfirmar_Click" Width="100px" />
            &nbsp;<asp:Button ID="btnCancelar" runat="server" OnClick="btnCancelar_Click" 
                Text="Cancelar" Width="100px" formnovalidate="formnovalidate"/>
        </div><br />
    </asp:Panel>
</asp:Content>
